<?php echo validation_errors(); ?>
<div id="edit-article">

    <form action="<?php echo base_url().'/backend/admin/artice/baiviet/edit/';if(isset($data->id)) echo $data->id ; ?>" method="post" >
    <div>
        <p><span>Tiêu đề</span></p>
        <p><input style="width:500px" type="text" name="title" value="<?php if(isset($data->title)) echo $data->title; ?>" /></p>
    </div>
    <div>
        <p><span>Alias</span></p>
        <p><input style="width:500px" type="text" name="alias" value="<?php if(isset($data->alias)) echo $data->alias; ?>" /></p>
    </div>
    <div>               
        <p><span>Danh mục</span>
        <select name="iddanhmuc">
            <?php 
            $danhmuc = $this->home_model->get_data('danhmuc');
            if(!empty($danhmuc)){
                foreach($danhmuc as $dm){
                    if($dm->id == $data->iddanhmuc){$selected = 'selected="selected"';}
                    else $selected = '';
                    echo '<option '.$selected.' value="'.$dm->id.'">'.$dm->title.'</option>';
                }
            }
            ?>
        </select> 
        </p>
    </div>
    <div>
        <p><span>Đăng lên</span>
        <?php $checked = 'checked="checked"' ;?>
        <input type="radio" <?php if(isset($data->publish)) echo $data->publish==1?$checked:''; else echo $checked ?> name="publish" value="1" /><span>Có</span>
        <input type="radio" <?php if(isset($data->publish)) echo $data->publish==0?$checked:''; ?> name="publish" value="0" /><span>Không</span>
        </p>
    </div>
    <div>
        <p><span>Nổi bật</span>
        <input type="radio" <?php if(isset($data->type)) echo $data->type==1?$checked:'';  ?> name="type" value="1" /><span>Có</span>
        <input type="radio" <?php if(isset($data->type)) echo $data->type==0?$checked:''; else echo $checked ?> name="type" value="0" /><span>Không</span>
        
        </p>
    </div>
    <div>
        <p><span>Miêu tả</span></p>
        <textarea cols="50" rows="4" name="metades" ><?php if(isset($data->metades)) echo ($data->metades != null)?$data->metades:''; ?></textarea>
    </div>
    <div>
        <p><span>Từ khóa</span></p>
        <textarea cols="50" rows="4" name="metakey" ><?php if(isset($data->metakey)) echo ($data->metakey != null)?$data->metakey:''; ?></textarea>
    </div>
    <div>
        <p><span>Intro</span></p>
        <textarea class="introtext" cols="50" rows="4" name="introtext" ><?php if(isset($data->introtext)) echo ($data->introtext != null)?$data->introtext:''; ?></textarea>
    </div>
    <div>
        <p><span>Nội dung</span></p>
        <textarea cols="50" rows="4" name="fulltext" ><?php if(isset($data->fulltext)) echo ($data->fulltext != null)?$data->fulltext:''; ?></textarea>
    </div>
    <div>
        <input type="submit"  value="Lưu Lại" />
    </div>
    </form>

</div>
<script type="text/javascript" src="<?php echo base_url().'/ckeditor/ckeditor.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'/ckeditor/sample.js';?>" ></script>

